#
#  Setup darkserver packages
#

- name: setup darkserver
  package: name={{ item }} state=present
  with_items:
    - darkserver
    - darkserver-importer

- name: email.json file
  copy: src=email.json dest=/etc/darkserver/email.json owner=root group=root mode=0644

- name: darkserverweb.conf
  template: src=darkserverweb.conf.j2 dest=/etc/darkserver/darkserverweb.conf owner=apache group=apache mode=0640
  notify: reload httpd

- name: darkjobworker.conf
  template: src=darkjobworker.conf.j2 dest=/etc/darkserver/darkjobworker.conf owner=apache group=apache mode=640
  notify: reload httpd

- name: Copy over settings.py
  when: env == "staging"
  template: src=settings.py
            dest=/etc/darkserver/settings.py
            mode=0600 owner=apache group=apache
  notify: reload httpd

